//
// Created by Administrator on 2022/12/21.
// 建立链表
//

#include <iostream>
using namespace std;

struct Node{
    int data;
    struct Node *next;
}Node;

void printList(struct Node *head)
{
    struct Node *cur = head;
    while(cur!=NULL)
    {
        printf("%d\n",cur->data);
        cur=cur->next;
    }
}

int main()
{
    struct Node n1;
    struct Node n2;
    struct Node n3;
    n1={1,&n2};
    n2={2,&n3};
    n3={3,NULL};
//    printf("%d",n1.next->data);
    struct Node *pp = &n1;
    printf("pp->data %d\n",pp->data);
    printList(&n1);
}